﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StrategyMode.Discount
{
    /// <summary>
    /// 折扣返利
    /// </summary>
    class DiscountReturn : DiscountBase
    {
        private double moneyCondition;
        private double moneyReturn;

        internal DiscountReturn(double condition, double moneyReturn)
        {
            moneyCondition = condition;
            this.moneyReturn = moneyReturn;
        }

        public override double GetResult(double money)
        {
            //获取当前满减的金额
            var subMoney = money / moneyCondition * moneyReturn;
            return money - subMoney;
        }
    }
}
